package com.fyzk.raceview;

import com.fyzk.raceview.gp11xuan5.Detail_GP11xuan5;
import com.fyzk.raceview.gpssc.Detail_GPSsc;
import com.fyzk.raceview.nxk3.Detail_Nxk3;
import com.fyzk.raceview.pl5.Detail_PL5;
import com.fyzk.raceview.qlc.Detail_QLC;
import com.fyzk.raceview.ssqdlt.Detail_SSQandDLT;
import com.fyzk.raceview.zc.Detail_ZC;
import com.fyzk.utils.LotteryIDUtils;

public class RaceFactory {

	public static RaceBaseView getRaceView(int lotteryId){
		switch (lotteryId) {
		case LotteryIDUtils.SSQ_LOTTERY_ID_INT://双色球
		case LotteryIDUtils.DLT_LOTTERY_ID_INT://大乐透
			return new Detail_SSQandDLT();
		case LotteryIDUtils.PL3_LOTTERY_ID_INT://排列3
		case LotteryIDUtils.PL5_LOTTERY_ID_INT://排列5
		case LotteryIDUtils.FC3D_LOTTERY_ID_INT://福彩3D
		case LotteryIDUtils.QXC_LOTTERY_ID_INT://七星彩
			return new Detail_PL5();
		case LotteryIDUtils.QLC_LOTTERY_ID_INT://七乐彩
			return new Detail_QLC();
		case LotteryIDUtils.SD11XUAN5_LOTTERY_ID_INT://高频11选5
		case LotteryIDUtils.GD11XUAN5_LOTTERY_ID_INT://广东11选5
			return new Detail_GP11xuan5();
		case LotteryIDUtils.CQSSC_LOTTERY_ID_INT://高频ssc
			return new Detail_GPSsc();
		case LotteryIDUtils.JZBF_LOTTERY_ID_INT://竞彩足球
		case LotteryIDUtils.JZBQC_LOTTERY_ID_INT://
		case LotteryIDUtils.JZHH_LOTTERY_ID_INT://
		case LotteryIDUtils.JZRFSPF_LOTTERY_ID_INT://
		case LotteryIDUtils.JZSPF_LOTTERY_ID_INT://
		case LotteryIDUtils.JZZJQ_LOTTERY_ID_INT://
		case LotteryIDUtils.DCSPF_LOTTERY_ID_INT://单场
		case LotteryIDUtils.DCZJQ_LOTTERY_ID_INT:
		case LotteryIDUtils.DCBQC_LOTTERY_ID_INT:
		case LotteryIDUtils.DCSXDS_LOTTERY_ID_INT:
		case LotteryIDUtils.DCBF_LOTTERY_ID_INT:
			return new RaceJingCaiView();
		case LotteryIDUtils.ZCBQC_LOTTERY_ID_INT://足彩
		case LotteryIDUtils.ZCJQC_LOTTERY_ID_INT://足彩
		case LotteryIDUtils.ZCSFC_LOTTERY_ID_INT://足彩
		case LotteryIDUtils.ZCRXJ_LOTTERY_ID_INT://足彩
			return new Detail_ZC();
		case LotteryIDUtils.NXK3_LOTTERY_ID_INT://
		case LotteryIDUtils.ANHUIK3_LOTTERY_ID_INT://
		case LotteryIDUtils.JSK3_LOTTERY_ID_INT://
		case LotteryIDUtils.JLK3_LOTTERY_ID_INT://
			return new Detail_Nxk3();
		default:
			break;
		}
		
		return new RaceJingCaiView();
	}
	
	public static RaceBaseView getRaceView(String lotteryType){
		int lotteryId = 0;
		try {
			lotteryId = Integer.parseInt(lotteryType);
		} catch (Exception e) {
			// TODO: handle exception
			lotteryId = LotteryIDUtils.SSQ_LOTTERY_ID_INT;
		}
		
		return getRaceView(lotteryId);
	}
}
